package com.distribute.framework.dao;

import java.util.List;
import java.util.Map;

import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.model.TbJxshIncome;

/**
 * 经销商收益的Dao接口
 * @author 刘代应
 */
@SuppressWarnings("unchecked")
public interface ITbJxshIncomeDao
{
	/**
	 * 获取所有经销商收益
	 * @return
	 */
	public List<TbJxshIncome> getTbJxshIncomeList(Map params,Integer offset,Integer size);

	/**
	 * 获取经销商收益统计
	 * @return
	 */
	public List getTbJxshIncomeStats(Map params,Map<String,Object> groups,Map<String,Object> sums);

	/**
	 * 获取经销商收益总数
	 * @return
	 */	
	public Long getTbJxshIncomeCount(Map params);
	
	/**
	 * 获取经销商收益自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public <T> T getTbJxshIncomeEval(String eval,Map params);
	
	/**
	 * 获取经销商收益分页
	 * @return
	 */	
	public Page getTbJxshIncomePage(int page,int size,Map params);
	
	/**
	 * 根据查询条件取经销商收益
	 * @param params
	 * @return
	 */
	public TbJxshIncome getTbJxshIncome(Map params);	

	/**
	 * 根据ID取经销商收益
	 * @param id
	 * @return
	 */
	public TbJxshIncome getTbJxshIncomeById(Long id);


	
	

	/**
	 * 保存经销商收益
	 * @param tbJxshIncome
	 */
	public TbJxshIncome saveTbJxshIncome(TbJxshIncome tbJxshIncome);

	/**
	 * 更新经销商收益
	 * @param tbJxshIncome
	 */
	public int updateTbJxshIncome(TbJxshIncome tbJxshIncome);
	/**
	 * 更新经销商收益非空字段
	 * @param tbJxshIncome
	 */
	public int updateTbJxshIncome$NotNull(TbJxshIncome tbJxshIncome);

	/**
	 * 根据ID删除一个经销商收益
	 * @param id
	 */
	public void deleteTbJxshIncomeById(Long id);
	
	/**
	 * 根据条件更新经销商收益
	 * @param values
	 * @param params
	 */
	public int updateTbJxshIncomeByConfirm(Map values, Map params);
	/**
	 * 根据条件删除经销商收益
	 * @param params
	 */
	public void deleteTbJxshIncomeByConfirm(Map params);
	
	/**
	 * 执行过程，以便事务回滚
	 * @param function
	 */
	public <T> T executeTransaction(Function function);

}